import axios from '@/libs/api.request'

export const login = (data) => {
  return axios.request({
    url: '/admin/login',
    data,
    method: 'post'
  })
}

// 添加
export const addMembers = (data) => {
  return axios.request({
    url: '/admin/member/add',
    data,
    method: 'post'
  })
}

// 修改
export const updateMember = (data) => {
  return axios.request({
    url: '/admin/member/update',
    data,
    method: 'post'
  })
}

// 删除
export const deleteMember = (id) => {
  return axios.request({
    url: `/admin/member/delete/${id}`,
    method: 'get'
  })
}

// 列表
export const memberList = (data) => {
  return axios.request({
    url: `/admin/member/page/list`,
    data,
    method: 'post'
  })
}
// 全部预警配置信息
export const warningFindAll = (data) => {
  return axios.request({
    url: `/admin/config/findAll`,
    method: 'get'
  })
}

// 会员预警列表
export const memberWarning = (data) => {
  return axios.request({
    url: `/admin/warning/memberWarning/page`,
    data,
    method: 'post'
  })
}

// 会员预警标记
export const signWarning = (data) => {
  return axios.request({
    url: `/admin/warning/sign/${data}`,
    method: 'get'
  })
}

// 查询会员信息
export const getByPhone = (phone) => {
  return axios.request({
    url: `/admin/member/getByPhone/${phone}`,
    method: 'get'
  })
}

// 导出会员列表
export const exportMember = (data) => {
  return axios.requestExcelt({
    url: `/admin/excel/memberList/export`,
    data,
    method: 'post'
  })
}
